/* Ejercicio 5.10
   ejer5_10.c */
#include <stdio.h>
#include <math.h>

/* Prototypes */
double round( double number );

/* function main begins program execution */
int main( void )
{
    double n;

    printf( "Enter a number (a negative number to finish: " );
    scanf( "%lf", &n );

    while ( n >= 0.0 ) {
        printf( "Number: %f\tRounded number %f\n", n, round( n ) );
        printf( "Enter a number (a negative number to finish: " );
        scanf( "%lf", &n );
    }

	return 0;
} /* end function main */

double round( double number )
{
    return floor( number + .5 );
}
